// vue.config.js

const path = require('path');

function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    devServer: {
        port: 8080,
        proxy: {
            '/apis': {
                target: 'http://localhost:8080', // target host
                //ws: true, // proxy websockets 
                //changeOrigin: true, // needed for virtual hosted sites
                pathRewrite: {
                    '^/apis': '/mock' // rewrite path
                }
            },
        }
    },
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@', resolve('src'))
            .set('styles', resolve('src/assets/styles'))
            .set('common', resolve('src/common'))
    }
};